﻿using System;

namespace 自定义异常
{
    public class CustomException : ApplicationException
    {
        public CustomException(string mess) : base(mess)
        {
        }
    }
    internal class Program
    {
        static void Main(string[] args)
        {
            int temperature = 0;
            if (temperature == 0)
            {
                throw (new CustomException("Zero Temperature found"));
            }
            else
            {
                Console.WriteLine("CustomException: {0}", temperature);
            }
        }
    }
}
